package com.chb.sso.factory;

import com.chb.sso.feign.PatientFeign;
import com.hos.entity.his.Patient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author: 陈海彬
 * @date: Created in 2023/12/19 11:24
 * @description:
 * @modified By:
 * @version:
 */
@Service
@Slf4j
public class PatientFeignFactory implements FallbackFactory<PatientFeign> {

    @Override
    public PatientFeign create(Throwable throwable) {
        log.error(throwable.getMessage());
        return new PatientFeign() {
            @Override
            public Patient selectPatientByPhone(String phone) {
                log.error("查询患者信息出现异常");
                return null;
            }
        };
    }

}